package homework_03;

import java.util.Scanner;

/**
 * 企业发放奖金问题
 */
public class Test_01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入当月利润：");
        double pro = sc.nextDouble();
        double comm = 0.0;
        if(pro <= 100000){      //swith需强转int  switch((int)pro/100000)
            comm = pro * 0.1;
        }else if(pro > 100000 && pro <= 200000){
            comm = 10000 + (pro - 100000) * 0.075;
        }else if(pro > 200000 && pro <= 400000){
            comm = 10000 + 7500 + (pro - 200000) * 0.05;
        }else if(pro > 400000 && pro <= 600000){
            comm = 10000 + 7500 + 10000 + (pro - 400000) * 0.03;
        }else if(pro > 600000 && pro <= 1000000){
            comm = 10000 + 7500 + 10000 + 6000 + (pro - 600000) * 0.015;
        }else if(pro > 1000000){
            comm = 10000 + 7500 + 10000 + 6000 + 6000 + (pro - 1000000) * 0.01;
        }
        System.out.println("当月应发奖金为：" + comm);
    }
}
